<template>
  <div>
    <el-card class="mb20" shadow="never">
      <plan-form @search="handleSearch" ref="planForm" />
    </el-card>
    <el-card shadow="never">
      <div class="mb20" style="text-align: right">
        <el-tooltip class="item" content="新增考评方案" effect="dark" placement="top">
          <el-button
            size="small"
            icon="el-icon-plus"
            v-if="$auth('eval:add')"
            type="primary"
            @click="handleAdd"
          />
        </el-tooltip>
      </div>
      <plan-list ref="planList" />
    </el-card>
  </div>
</template>

<script>
import PlanForm from './PlanForm'
import PlanList from './PlanList'
export default {
  components: {
    PlanForm,
    PlanList
  },
  methods: {
    handleSearch(param) {
      console.log('param', param)
      this.$refs.planList.getPlanList(param)
    },
    handleAdd() {
      this.$router.push({
        name: 'evaluateCreatePlan',
        params: { type: 'add' }
      })
    }
    // handleEdit(type, row) {
    //   this.$refs.planModal.edit(type, row)
    // }
  }
}
</script>
